package assignment.work01;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class Work01Aspect {
//	public Work01Aspect() {
//		 System.out.println("Work01Aspect");
//	}
	@Pointcut(value="execution(* assignment.work01.Work01*.*say(..))")
	public void pointcut() {
	}
	
	@Before(value="pointcut()")
	public void before() {
		System.out.println("Aspect before");
	}
	
	@Around("pointcut()")
	public void around(ProceedingJoinPoint joinPoint) throws Throwable {
		System.out.println("Aspect around before");
		joinPoint.proceed();
		System.out.println("Aspect around after");
	}
}
